﻿<%@ Page Language="C#" MasterPageFile="~/master/ThreeColumnLayout.master" AutoEventWireup="true" CodeFile="shoplist.aspx.cs" Inherits="page_public_shoplist" Title="Untitled Page" %>
<%@ Register Src="~/control/VerticalMenu.ascx" TagPrefix="ucc" TagName="verticalMenu" %>
<%@ Register Src="~/control/VerticalAdvertise.ascx" TagPrefix="ucc" TagName="verticalAdvertise" %>
<%@ Register Src="~/control/common/DataPager.ascx" TagPrefix="ucc" TagName="dataPager" %>
<%@ Register Src="~/control/ShopFilter.ascx" TagPrefix="ucc" TagName="shopFilter" %>

<asp:Content ID="ContentLeft" ContentPlaceHolderID="LeftPlaceHolder" Runat="Server">
    <ucc:verticalMenu ID="leftMenu" runat="server" />
</asp:Content>
<asp:Content ID="ContentMiddle" ContentPlaceHolderID="MiddlePlaceHolder" Runat="Server">
    <table width="520px" border="0">
        <tr>
            <td>
                <asp:Repeater ID="shopList" runat="server" OnItemDataBound="ShopListDataBound">
                    <ItemTemplate>
                        <table style="background-color:#f8f8f8; margin-bottom:6px;" cellpadding="0" cellspacing="0">
                            <tr>
                                <td align="left" valign="top">
                                    <asp:Image ID="topLeft" runat="server" ImageUrl="~/App_Themes/Red/image/top-left.jpg" 
                                        AlternateText="top-left" />
                                </td>
                                <td style="border-top:solid 1px #ebebeb"></td>
                                <td align="right" valign="top">
                                    <asp:Image ID="topRight" runat="server" ImageUrl="~/App_Themes/Red/image/top-right.jpg" 
                                        AlternateText="top-right" />
                                </td>
                            </tr>
                            <tr>
                                <td style="border-left:solid 1px #ebebeb"></td>
                                <td style="border:solid 1px #ebebeb">
                                    <table class="shopListText">
                                        <tr>
                                            <td rowspan="3" style="width:105px; height:105px;" align="center" valign="middle">
                                                <a href='shopdetail.aspx?id=<%# DataBinder.Eval(Container.DataItem, "id")%>'>
                                                    <asp:Image ImageUrl='<%# DataBinder.Eval(Container.DataItem, "ShopLogoPath")%>'
                                                        AlternateText="shop image" CssClass="shopLogo" runat="server" />
                                                </a>
                                            </td>
                                            <td  valign="top" style="width:300px;" valign="top" align="left">
                                                <span class="shopTitle"><%# DataBinder.Eval(Container.DataItem, "ShopName")%> </span>
                                                <span class="shopCode">(#<%# DataBinder.Eval(Container.DataItem, "ShopCode")%>)</span>
                                            </td>
                                            <td style="width:120px;" valign="top" align="right">
                                                Rating <asp:Image runat="server" ImageUrl='<%# GetRatingImagePath(DataBinder.Eval(Container.DataItem, "rating"))%>'
                                                    AlternateText='<%# DataBinder.Eval(Container.DataItem, "rating")%>' />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <%# DataBinder.Eval(Container.DataItem, "BranchAddress")%>
                                            </td>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td align="left" valign="baseline">
                                                Top categories:<br />
                                                <asp:Repeater ID="shopTopCategories" runat="server">
                                                    <ItemTemplate>
                                                        <a href='productlist.aspx?id=<%# DataBinder.Eval(Container.DataItem, "id")%>'>
                                                            <%# DataBinder.Eval(Container.DataItem, "category_name")%>
                                                        </a>&nbsp;
                                                    </ItemTemplate>
                                                </asp:Repeater>
                                            </td>
                                            <td align="right" valign="bottom">
                                                <a href='shopdetail.aspx?id=<%# DataBinder.Eval(Container.DataItem, "id")%>'>
                                                    <img src="#" id="GotoShop" alt="Goto Shop" runat="server" />
                                                </a>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                <td style="border-right:solid 1px #ebebeb"></td>
                            </tr>
                            <tr>
                                <td align="left" valign="top">
                                    <asp:Image ID="bottomLeft" runat="server" ImageUrl="~/App_Themes/Red/image/bottom-left.jpg"
                                        AlternateText="bottom-left" />
                                </td>
                                <td style="border-bottom:solid 1px #ebebeb"></td>
                                <td align="right" valign="top">
                                    <asp:Image ID="Image1" runat="server" ImageUrl="~/App_Themes/Red/image/bottom-right.jpg"
                                        AlternateText="bottom-right" />
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </asp:Repeater>
            </td>
        </tr>
        <tr>
            <td align="right">
                <ucc:dataPager ID="dataPager" runat="server" PageSize="5" MaxPageLinks="5"/>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="ContentRight" ContentPlaceHolderID="RightPlaceHolder" Runat="Server">
    <table>
        <tr>
            <td>
                <ucc:shopFilter ID="shopFilter" runat="server" />
            </td>
        </tr>
        <tr>
            <td>
                <ucc:verticalAdvertise ID="rightAdvertise" runat="server" 
                    ContentType="HomePageVerticalAdvertisement" />
            </td>
        </tr>
    </table>
</asp:Content>

